import request from '@/utils/request'

/**
 * 查询
 * @param {Object} params
 */
export function dataApi(params) {
    return request({
        url: '/api/product/data',
        method: 'get',
        params
    })
}


/**
 * 新增
 * @param {Object} data
 */
export function addApi(data) {
    return request({
        url: '/api/product',
        method: 'post',
        data
    })
}

/**
 * 修改
 * @param {Object} data
 */
export function editApi(data) {
    return request({
        url: '/api/product',
        method: 'put',
        data
    })
}


/** 根据主键查询
 * @param {Object} id
 */
export function findByIdApi(id) {
    return request({
        url: '/api/product/'+id,
        method: 'get'
    })
}


/**
 * 上下架操作API
 * @param {Object} ids
 */
export function upOrDownApi(ids,status){
  return request({
      url:  '/api/product/isgrounding?status='+status+'&ids='+ids,
      method: 'GET'
    })
}


/**
 * 读取口味列表API
 */
export function dishFlavorApi(){
  return request({
      url:  '/api/product/dishflavor',
      method: 'GET'
    })
}

